#include "mfui/textbutton.hpp"
#include "mfui/layout.hpp"

namespace VN2{
	using namespace MFUI;
	class StartButton:public TextButton{
		public:
		StartButton(TTF_Font* font);
		void released(Window* w,SDL_FPoint& p)override;
	};
	class LoadButton:public TextButton{
		public:
		LoadButton(TTF_Font* font);
		void released(Window* w,SDL_FPoint& p)override;
	};
	class SettingButton:public TextButton{
		public:
		SettingButton(TTF_Font* font);
		void released(Window* w,SDL_FPoint& p)override;
	};
	//包括版本号
	class AboutButton:public TextButton{
		public:
		AboutButton(TTF_Font* font);
		void released(Window* w,SDL_FPoint& p)override;
	};
	class QuitButton:public TextButton{
		public:
		QuitButton(TTF_Font* font);
		void released(Window* w,SDL_FPoint& p)override;
	};
	class OptionMenu:public VBoxLayout{
		public:
		enum ButtonType{start=0,load,setting,about,helper,quit};
		//替换已有UI按钮
		void replacebutton(ButtonType t,Button* v);
		OptionMenu(TTF_Font* font);
	};
	//渲染默认背景图
	class MainMenuLayout:public Node{
		protected:
		SDL_Texture* back;
		float sep;
		SDL_Color cover;

		public:
		//自行管理back资源 sep为菜单栏占比
		MainMenuLayout(SDL_Texture* back,SDL_Color menucover,float sep=0.2f);

		void draw(SDL_Renderer* r,SDL_Texture* screen,bool updatecache)override;
		~MainMenuLayout()override;
		bool confirmdraw()override;
	};
}